import request from '@/utils/request'
import { Chapter, ChapterInfoVo } from './type'
const baseUrl = '/chapter'

export const reqChapterAndSectionVo = (courseId: string) =>
  request.get<any, ResponseData<ChapterInfoVo[]>>(`${baseUrl}/info/${courseId}`)

export const reqAddChapter = (data: Chapter) =>
  request.post<any, ResponseData>(`${baseUrl}`, data)

export const reqUpdateChapter = (data: Chapter) =>
  request.put<any, ResponseData>(`${baseUrl}`, data)

export const reqDelChapter = (chapterId: string) =>
  request.delete<any, ResponseData>(`${baseUrl}/${chapterId}`)
